#include "mainwindow.h"
#include <QApplication>
#include <QTreeView>
#include <QFileSystemModel>
#include <QComboBox>
#include <QDir>
#include <QStandardItemModel>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    // 创建文件系统模型
    //QFileSystemModel *model = new QFileSystemModel(&w);
    // 指定要监视的目录
    //model->setRootPath(QDir::currentPath());
    QStandardItemModel*  treeModel = new QStandardItemModel;
    for (int var = 0; var < 10; ++var) {
        int treeRow = treeModel->rowCount();
        QStandardItem * item = new QStandardItem("xuehua");
        treeModel->setItem(treeRow, item);
    }
    for (int var = 0; var < 10; ++var) {
        QStandardItem * item = new QStandardItem("xuehua");
        treeModel->item(3)->setChild(var,item);
    }
    QTreeView *tree = new QTreeView(&w);
    tree->setModel(treeModel);
    //tree->setRootIndex(model->index(QDir::currentPath()));
    QComboBox *b = new QComboBox(&w);
    b->resize(400, 20);
    b->setView(tree);
    b->setModel(treeModel);
    b->show();

    w.show();

    return a.exec();
}
